<template>

  <a-modal :title="title"
           :width="800"
           :visible="listVisible"
           @ok="handleCancel"
           @cancel="listVisible=false"
           cancelText="关闭"
  >

    <a-card :bordered="false">

      <!-- table区域 -->
    <a-table
      ref="table"
      size="middle"
      :scroll="{x:true}"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="doctor"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
      class="j-table-force-nowrap"
      @change="handleTableChange">


    </a-table>


      </a-card>
  </a-modal>


</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { mixinDevice } from '@/utils/mixin'

import WxUserinfoModal from '@/views/wuser/WxUserinfoModal'
import Area from '@comp/_util/Area'
import { getAction } from '@api/manage'
import PatientDataModal from '../../patient/modules/PatientDataModal'

export default {
  name: "DoctorAssistantModal",


  mixins:[JeecgListMixin, mixinDevice],
  components: {
    WxUserinfoModal,
    PatientDataModal
  },
  data () {
    return {
      description: 'doctor_assistant管理页面',
      title:"服务医生",
      listVisible:false,
      visible: false,
      doctorId:'',
      labelCol: {
        xs: { span: 8 },
        sm: { span: 8 },

      },
      wrapperCol: {
        xs: { span: 20 },
        sm: { span: 16 },
      },
      doctor:{},
      columns: [
        {
          title: '编号',
          dataIndex: 'id',
          key: 'id'
        },
        {
          title: '服务医生姓名',
          dataIndex: 'name',
          key: 'name'
        },
        {
          title: '服务状态',
          dataIndex: 'status',
          key: 'status',
          customRender:function (res) {
            var status = "";
            if(res == 0){
              status = "无效";
            }else if(res == 1){
              status = "有效";
            }
            return status;
          }
        },
      ],
      url: {
        list: "/doctor/doctorAssistantRelation/doctorList",
      },

    }
  },
  created() {
    this.showAssistan();
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    },
  },
  methods: {
    initDictConfig(){
    },
    showAssistan(record){

      let param = {};

      param.id = record.id;

      getAction(`/doctor/doctorAssistantRelation/doctorList`, param).then(res => {

        this.doctor = res.result;
      })

      this.listVisible = true;
    },


    handleCancel(){
      this.listVisible = false;
    },

  }

}
</script>

<style scoped>
@import '~@assets/less/common.less';
</style>